<!-- redis版本升级 -->
<div id="upgradeRedisVersionModal${appDetail.appDesc.appId}" class="modal fade" tabindex="-1">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Redis版本升级流程</h4><b style="font-size:12px;color:red"><i>只支持小版本号升级</i></b>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-hidden="true"></button>
            </div>
            <div class="modal-body">
                <div class="row bs-wizard" style="border-bottom:0;">
                    <div id="versionUpgrade${appDetail.appDesc.appId}" class="col-sm-2 bs-wizard-step warn complete">
                        <div class="text-center bs-wizard-stepnum">1.升级版本选择</div>
                        <div class="progress"><div class="progress-bar"></div></div>
                        <a href="#" class="bs-wizard-dot"></a>
                        <div class="bs-wizard-info text-center">版本检查</div>
                    </div>

                    <div id="instanceCheck${appDetail.appDesc.appId}" class="col-sm-2 bs-wizard-step disabled">
                        <div class="text-center bs-wizard-stepnum">2.实例配置检查</div>
                        <div class="progress"><div class="progress-bar"></div></div>
                        <a href="#" class="bs-wizard-dot"></a>
                        <div class="bs-wizard-info text-center">配置检查</div>
                    </div>

                    <div id="slaveUpdate${appDetail.appDesc.appId}" class="col-sm-2 bs-wizard-step disabled">
                        <div class="text-center bs-wizard-stepnum">3.Slave配置更新</div>
                        <div class="progress"><div class="progress-bar"></div></div>
                        <a href="#" class="bs-wizard-dot"></a>
                        <div class="bs-wizard-info text-center">更新配置并重启</div>
                    </div>

                    <div id="msFailover${appDetail.appDesc.appId}" class="col-sm-2 bs-wizard-step disabled">
                        <div class="text-center bs-wizard-stepnum">4.主从节点Failover</div>
                        <div class="progress"><div class="progress-bar"></div></div>
                        <a href="#" class="bs-wizard-dot"></a>
                        <div class="bs-wizard-info text-center">主从节点切换</div>
                    </div>

                    <div id="newSlaveUpdate${appDetail.appDesc.appId}" class="col-sm-2 bs-wizard-step disabled">
                        <div class="text-center bs-wizard-stepnum">5.新Slave配置更新</div>
                        <div class="progress"><div class="progress-bar"></div></div>
                        <a href="#" class="bs-wizard-dot"></a>
                        <div class="bs-wizard-info text-center">更新配置并重启</div>
                    </div>
                    <div id="upgradeComplete${appDetail.appDesc.appId}" class="col-sm-1 bs-wizard-step disabled">
                        <div class="text-center bs-wizard-stepnum">6.升级完成</div>
                        <div class="progress"><div class="progress-bar"></div></div>
                        <a href="#" class="bs-wizard-dot"></a>
                        <div class="bs-wizard-info text-center">集群实例及版本信息</div>
                    </div>
                </div>
                <form class="form-horizontal form-bordered form-row-stripped" id="ns">
                    <div class="form-body">
                        <div class="form-group row">
                            <label class="col-form-label col-md-3 me-4 text-end"> 应用ID: </label>
                            <div class="col-md-8">
                                <label id="appId${appDetail.appDesc.appId}" name="appId" class="form-control" >${appDetail.appDesc.appId}</label>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-form-label col-md-3 me-4 text-end"> 当前版本号: </label>
                            <div class="col-md-4">
                                <label id="appVersion${appDetail.appDesc.appId}" name="appVersion" class="form-control" >${appDetail.appDesc.versionName}</label>
                            </div>

                        </div>
                        <div class="form-group row" hidden="hidden" id="div${appDetail.appDesc.appId}">
                            <label class="col-form-label col-md-3 me-4 text-end"> <a target="_blank" href="${request.contextPath}/admin/app/index?appId=${appDetail.appDesc.appId}">实例信息</a>: </label>
                            <div class="col-md-6">
                                <textarea id="instanceInfo${appDetail.appDesc.appId}" type="text" rows="8" class="form-control" readonly></textarea>
                            </div>
                            <label id="instanceLog${appDetail.appDesc.appId}" class="col-form-label col-md-2"></label>
                        </div>


                        <div class="form-group row">
                            <#assign currentVersion = appDetail.appDesc.versionName?substring(0, appDetail.appDesc.versionName?lastIndexOf('.'))>
                            <label class="col-form-label col-md-3 me-4 text-end"> 可升级版本:</label>
                            <div class="col-md-4">
                                <select id="versionSelect${appDetail.appDesc.appId}" class="form-select select2_category" title="请选择" data-live-search-placeholder="搜索" name="ip" data-live-search="true">
                                    <#list redisVersionList as version>
                                        <#if (version.name?indexOf(currentVersion)> -1) && (appDetail.appDesc.versionName != (version.name))>
                                            <option versionid="${version.id!}">${version.name!}</option>
                                        </#if>
                                    </#list>
                                </select>
                            </div>
                             <label class="col-form-label col-md-auto ms-3"><a class="button" target="_blank" onclick="configPreview(${appDetail.appDesc.appId})"> Redis配置预览</a></label>&nbsp;&nbsp;&nbsp;
                             <label class="col-form-label col-md-auto ms-3"><a class="button" target="_blank" onclick="configContrast('${appDetail.appDesc.versionId}','${appDetail.appDesc.appId}')"> 升级配置对比</a></label>
                        </div>
                        <div class="form-group row">
                            <label class="col-form-label col-md-3 me-4 text-end"> 提示: </label>
                            <div class="col-md-8">
                                <div class="form-control-static">如果在升级过程中遇到错误警告，请登录服务器解决后再<b style="color:cornflowerblue	">继续</b>执行</div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-bs-toggle="modal" onclick="install(${appDetail.appDesc.appId})"><span id="install${appDetail.appDesc.appId}">一键升级</span></button>
            </div>
        </div>
    </div>
</div>